
#include "xmppconnection.h"
#include "xmpplogintask.h"
#include "tcpsocket.h"

namespace tinkle {

XmppConnection::XmppConnection(const std::string &host,
    const std::string &port,
    const std::string &serviceName)
    : _sock(NULL) {
    _host = host;
    _port = port;
    _serviceName = serviceName;
}

XmppConnection::~XmppConnection() {
    //blank line
    if (!_sock) {
        delete _sock;
    }
}

int XmppConnection::Connect() {
    //_sock = new TCPSocket(_host, _port);
    //return _sock->Connect();
    return 0;
}

int XmppConnection::Login(const std::string &user, const std::string &pwd) {
    //XmppLoginTask *_loginTask = new XmppLoginTask(user, pwd, NULL);
    //_loginTask->Start();
    return 0;
}

std::string XmppConnection::GetHost() {
    return _host;
}

std::string XmppConnection::GetPort() {
    return _port;
}

}   //namespace tinkle